let back = document.querySelector(".back");

let host = "http://127.0.0.1:1337";
let token = localStorage.getItem("token");
// 获取用户信息
let user = document.querySelector(".order-head-right .user");
// 获取用户名
let uinfoUrl = host + "/api/v1/user/info";
// 头部设置token参数
axios.defaults.headers.common["token"] = token;
let uname = axios.get(uinfoUrl);

uname.then(function(res) {
    let userName = res.data.data.userName;
    user.innerHTML = userName;
})

let goodsinfo = document.querySelector(".goodsinfo span");

let receiveinfo =  JSON.parse(localStorage.getItem("receiverinfo"));

console.log(receiveinfo);

goodsinfo.innerHTML = receiveinfo.receiver +"&nbsp;&nbsp;&nbsp;"+receiveinfo.address;

back.onclick = function() {
    location.href = "cars.html"
}

